package com.njym.java.security.app.rest;

import com.njym.java.security.app.biz.FamilyInformBiz;
import com.njym.java.security.app.entity.FamilyInform;
import com.njym.java.security.common.msg.ObjectRestResponse;
import com.njym.java.security.common.rest.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/familyInform")
public class FamilyInformController extends BaseController<FamilyInformBiz, FamilyInform> {

	@RequestMapping(value = "/inform", method = RequestMethod.GET)
	@ResponseBody
	public ObjectRestResponse slide() {
		List<FamilyInform> list = baseBiz.getInform();
		Map<String, Object> map = new HashMap<>(2);
		map.put("data", list);
		map.put("total", list.size());
		return new ObjectRestResponse<>().rel(true).data(map);
	}
}
